#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <vector>

int main()
{
	std::vector<boost::shared_ptr<int> > v; //*exception safety for dynamically allocated object
	v.push_back(boost::shared_ptr<int>(new int(1)));
	v.push_back(boost::shared_ptr<int>(new int(2)));

	//*allocate the shared object and internal reference counter in one step
	boost::shared_ptr<int> i1 = boost::make_shared<int>(1); //* more efficiently
	boost::shared_ptr<int> i2(i1);
}